package com.zyx.controller;

import com.zyx.dto.R;
import com.zyx.service.Exception401;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler
    public R handler401(Exception401 e) {
        return R.error(401, e.getMessage());
    }
}
